package com.wu.solon.database.lazy.starter.simple.controller;

import com.wu.solon.database.lazy.starter.simple.domain.SysUserBatch;
import com.wu.solon.database.lazy.starter.simple.service.SysUserBatchService;
import com.wu.solon.database.lazy.starter.simple.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.wu.framework.web.solon.EasyController;

import java.util.Arrays;

@Api(tags = "批量操作")
@EasyController("/batch")
@Controller
public class BatchController {

    @Inject
    private SysUserService sysUserService;
    @Inject
    private SysUserBatchService sysUserBatchService;


    /**
     * 用户信息简单插入
     */
//    @PostConstruct
    @ApiOperation("用户信息简单插入")
    @Mapping("/mybatis/batch")
    public void mybatisBatch() {
        SysUserBatch sysUserBatch = new SysUserBatch();
        sysUserBatch.setId(2024L);
        sysUserBatchService.saveBatch(Arrays.asList(sysUserBatch));
    }

}
